/*
********************************************************************************
* Copyright (C) 2021, xiang.D <dx_65535@163.com>.
* All right reserved.
*
* File Name   : invoker.h
* Author      :
* Version     : V1.0
* Description :
* Journal     : 2021-11-27 init v1.0
* Brief       : Blog: https://blog.csdn.net/qq_38750572?spm=1001.2014.3001.5343
* Others      :
********************************************************************************
*/

#ifndef __INVOKER_H__
#define __INVOKER_H__

#include "cmd_type.h"
#include "cmd_abstract.h"
#include <map>

class CInvoker
{
public:
    CInvoker();

    ~CInvoker();

    static CInvoker* GetInstance();

    int Init();

    int CmdRegister(ECmdType cmdType, CCmd *pCmd);

    int Invoke(ECmdAction cmd);

private:
    std::map<ECmdType, CCmd *> mCmdTable;
};

#endif

